class  DivDemo  {
    int  div(int  a,int  b)  throws  ArithmeticException,ArrayIndexOutOfBoundsException  {
        int  []arr  =  new  int  [a];
        System.out.println(arr[10]);
        return  a/b;
    }
}

public  class  ExceptionDemo  {

    public  static  void  main(String[]args)  {
        DivDemo  d  =  new  DivDemo();
        int  type  =  Integer.parseInt(args[0]);
        int  a  =  Integer.parseInt(args[1]);
        int  b  =  Integer.parseInt(args[2]);

        try  {
            if(type  <  0)  {
                //  add  throw  Exception
                throw new Exception("java.lang.Exception: NegativeException");

            }
            int  x  =  d.div(a,b);
            System.out.println("x="+x);
        }
        //  add  two  catch
        catch (Exception e) {
            try {
                throw new Exception(e);
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        }


        //  add  catch


        {
            System.out.println(e.toString());
        }
                finally  {


        }

    }
}